<template>
  <div>
    <!-- v-validate是组件提供的指令， 形式1：字符串形式-->
    <input v-validate="'required|email'" name="email" type="text" />
    <span>{{ errors.first('email') }}</span>
    <!-- 形式2 对象形式 -->
    <input v-validate="{ required: true, email: true }" name="myemail" type="text" />
    <span>{{ errors.first('myemail') }}</span>
    <br />
    <!-- 自定义的表单验证规则 -->
    <input v-validate="{ required: true, phone: true }" name="phone" type="text" />
    <span>{{ errors.first('phone') }}</span>
  </div>
</template>

<script>
export default {
  name: 'TextV'
}
</script>

<style lang="less" scoped></style>
